package com.lg.erp.controller.chenximou;

import com.lg.erp.entity.JsonResult;
import com.lg.erp.entity.chenximou.Order;
import com.lg.erp.entity.chenximou.OrderStatus;
import com.lg.erp.service.chenximou.IOrderStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class OrderStatusController {
    
    @Autowired
    IOrderStatusService orderStatusService;

    @RequestMapping(value = "/orderStatus",method = RequestMethod.GET)
    public JsonResult list(){
        List<OrderStatus> list = orderStatusService.getAllOrderStatus();
        System.out.println("订单状态的集合"+list);
//        req.getSession().setAttribute("productBrandList",list);
        return new JsonResult(1,"success",list);
    }
    
    @ResponseBody
    @PostMapping("/orderStatus")
    public JsonResult list2(@RequestBody Order order){
        System.out.println("状态："+order.getOrderStatus());
        List<OrderStatus> list = orderStatusService.getOrderStatusById(order);
        System.out.println("订单状态的集合"+list);
//        req.getSession().setAttribute("productBrandList",list);
        return new JsonResult(1,"success",list);
    }
}
